package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PalletsMapper;
import com.ruoyi.system.domain.Pallets;
import com.ruoyi.system.service.IPalletsService;

/**
 * 货盘Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-23
 */
@Service
public class PalletsServiceImpl implements IPalletsService 
{
    @Autowired
    private PalletsMapper palletsMapper;

    /**
     * 查询货盘
     * 
     * @param id 货盘主键
     * @return 货盘
     */
    @Override
    public Pallets selectPalletsById(Long id)
    {
        return palletsMapper.selectPalletsById(id);
    }

    /**
     * 查询货盘列表
     * 
     * @param pallets 货盘
     * @return 货盘
     */
    @Override
    public List<Pallets> selectPalletsList(Pallets pallets)
    {
        return palletsMapper.selectPalletsList(pallets);
    }

    /**
     * 新增货盘
     * 
     * @param pallets 货盘
     * @return 结果
     */
    @Override
    public int insertPallets(Pallets pallets)
    {
        pallets.setCreateTime(DateUtils.getNowDate());
        return palletsMapper.insertPallets(pallets);
    }

    /**
     * 修改货盘
     * 
     * @param pallets 货盘
     * @return 结果
     */
    @Override
    public int updatePallets(Pallets pallets)
    {
        return palletsMapper.updatePallets(pallets);
    }

    /**
     * 批量删除货盘
     * 
     * @param ids 需要删除的货盘主键
     * @return 结果
     */
    @Override
    public int deletePalletsByIds(Long[] ids)
    {
        return palletsMapper.deletePalletsByIds(ids);
    }

    /**
     * 删除货盘信息
     * 
     * @param id 货盘主键
     * @return 结果
     */
    @Override
    public int deletePalletsById(Long id)
    {
        return palletsMapper.deletePalletsById(id);
    }
}
